Amplification Module-

Tasks Accomplished-
1) Add Ampification Records- Can add Amplification records for both left and right ear at the same time.
2) Edit an Amplification Record
3) Delete an Amplification Record
4) Display a list of Amplification records for a particular baby.

Design -
1) Amplifiation.aspx page - contains Amplification.ascx control.
2) Amplification.ascx control has -
	a) Datagrid - Displays the amplification records for the baby. The datagrid columns have the following fields-
	   select, ear, style, type, processing type, date fitted, discontinued date, audiologist.	    
	b) Add button (html) - On clicking the Add button, AddAmplification.aspx page pops up.
	c) Edit button (html) - First select an Amplification record, then on clicking the Edit butoon,
	   EditAmplification.aspx page pops up.
	d) Delete button (web form) - On clicking the delete button, a message box pops up with a message asking you 
	   if you want to delete the record or not.	
3) AddAmplification.aspx (popup page)- contains AddAmplification.ascx control.
4) EditAmplification.aspx (popup page) - contains EditAmplificationRecord control.
5) AddAmplifiction.ascx control has -
	a) Ear , Style, Type, Processing Type, Date Fitted , audiologist, discontinued date, manufacturer, model number,
	   serial number, warranty date, purchase date.	  
	b) Add button (html) - On clicking the add button the values are saved in the database, the pop up page 
	   AddAmplification.aspx closes and the datagrid in the Amplication.ascx control is updated with the new records.
	c) Cancel button (html) - On clicking the cancel button the popup page AddAmplification.aspx closes.    
6) EditAmplification.ascx control has- 
	a) Ear , Style, Type, Processing Type, Date Fitted, audiologist, discontinued date, manufacturer, model number,
	   serial number, warranty date, purchase date. 	 
	b) Edit button (html) - On clicking the edit button the edited values are saved in the database, the pop up page 
	   EditAmplification.aspx closes and the datagrid in the A  
	c) Cancel button (html)   - On clicking the cancel button the popup page EditAmplification.aspx closes.

Implementation -
A) Web Presentation Layer -
1) Amplification.ascx-
	a) EnableModify()- is used to enable or disable the buttons as needed.
	b) BindDataSets()-  is used to bind the datagrid with the dataset that you can get from BL .
	c) SetId() - is used to set the amplification id selected to a session.
	d) btnDeleteAmplification_Click() - handles the delete button event, and deletes the amplification record.
	
2) AddAmplification.ascx -
	a) getAddValue() - is used to get the value of the Hidden Variable which is set to "yes", in the javascript when the	
	   add button is clicked.
	b) BindDDLs() - is used to call functions which bind the dropdown lists for Audiologists, Style, Type and ProcessingType
	   to the datasets for both the left and the right ears.
	c) Add() - is used to call functions which will add the value to the database by calling BL functions.
	d) requiredLeftFieldsNotEntered() - is used to check if all the required field values for Left ear i.e. audiologist, style,
	   type and processing type are entered and returns a boolean value. Based on the check an error message is displayed.
	e) requiredRightFieldsNotEntered() -  is used to check if all the required field values for Right ear i.e. audiologist, style,
	   type and processing type are entered and returns a boolean value. Based on the check an error message is displayed. 	  
	f) setLabel() - is used to set the error message if all fields are not set.
	g) getBabyId() - returns the baby id.
	h) insertAmplificationRecord() - calls functions to insert the values based on ear type("left" or "right").
	i) insertLeftEar() - inserts the value into the database by calling a BL function for the left ear.
	j) insertRightEar() - inserts the value into the database by calling a BL function for the right ear.   
	k) notBothEarsNull() - returns a boolean value depending on whether no values are entered for both the ears.
	l) bothEarsNull() - returns a boolean value depending on whether no values are entered for both the ears.
	m) isLeftEarNull() - checks to see if the values entered for the left ear are all null and returns a boolean value.
	n) isRightEarNull() - checks to see if the values entered for the left ear are all null and returns a boolean value.
	o) getL_Date_Fitted() - returns the date fitted value for the left ear.
	p) getL_Discontinued_Date() - returns the date discontinued value for the left ear.
    q) getL_Warranty_Date() - returns the warranty date value for the left ear.
    r) getL_Date_Of_Purchase() - returns the purchase date value for the left ear.
    s) getR_Date_Fitted() - returns the date fitted value for the right ear.
    t) getR_Discontinued_Date() - returns the date discontinued value for the right ear.
    u) getR_Warranty_Date() - returns the warranty date value for the right ear.
    v) getR_Date_Of_Purchase() - returns the purchase date value for the right ear.

3) EditAmplification.ascx - Is very much similar to AddAmplification.ascx except that it sets the values for the required fields 
	first and is used only for one ear.
	a) getAddValue() - same as above
	b) BindDDLs() same as above
	c) bindValues() - binds the values for all the fields
	d) setSessionFitterId() - binds the audiologist ddl value.
	e) setTextBoxes()- binds the values of textboxes.
	f) setDates() - binds the date values, obtained from the hidden variables of the date controls, dependin gon whether the
	   values are null or not.
	g) FindDropDownIndex() - is used to find the index of the selected item in the drop down list.
	h) getBabyId() - same as above.
	i) Add() - same as above but only for one ear.
	j) requiredLeftFieldsNotEntered() - same as above.
	k) setLabel() - same as above.
	l) insertAmplificationRecord() - same as above but only for one ear. (kept so that can be pulled up later when there is a
	   common control for edit and add).
	m) EditEar()  - edits the values for the amplification record by calling the BL function.
	n) o) getL_Date_Fitted() - same as above.
	p) getL_Discontinued_Date() - same as above.
    q) getL_Warranty_Date() - same as above.
    r) getL_Date_Of_Purchase() - same as above.
    s) getR_Date_Fitted() - same as above.
    
B) Business Layer-
	a) CreateAmplification() - Creates a new amplification record in the database in the amplification table.
	b) EditAmplification() - Edits the amplification record in the database in the amplification table.
	c) DeleteAmplification() - deletes the amplification record from the database.
	d) AmplificationRecords() - returns a dataset containing all the amplification records for a particular baby.
	e) Amplification() - returns the integer value of the position of the particular amplification record in the dataset. 
	
Future Tasks- 
The AddAmplification.ascx and EditAmplificationRecord.ascx can both be merged into a single control, when the new date control 
is ready. The problem with the existing date control is that it appends the name of the control and so two controls cannot 
be present on the same page. When using the new control the design will be, the AddAmplification will have two
controls(suppose, AddAmplificationNew) enabled when the add button is clicked, when the edit button is cliked on one contol will
be enabled and will be filled with all the values.


